package com.time.sky.mapper;

import com.time.sky.entity.Tinfo;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface TinfoMapper {
    @Select("SELECT * FROM Tinfo t LEFT JOIN UINFO u ON t.uid=u.uid LEFT JOIN BINFO b ON u.bid=b.bid")
    List<Tinfo> selectList();
    @Insert("insert into Tinfo(tname,tsex,tic,ttele,zq,zfrq,uid) " +
            "values(#{tname},#{tsex},#{tic},#{tele},#{zq},#{zfrq},#{uid})")
    void add(Tinfo tinfo);
    @Delete("delete from Tinfo where tid=#{tid}")
    void delete(int tid);
    @Select("SELECT * FROM Tinfo  where tid=#{tid}")
    Tinfo getById(int tid);
    @Update("update Tinfo set tname=#{tname},tsex=#{tsex},tic=#{tic},ttele=#{ttele},zq=#{zq},zfrq=#{zfrq},uid=#{uid} where tid=#{tid}")
    void update(Tinfo tinfo);
    @Select("select count(*) from Tinfo")
    int getRowCount();
}
